﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:Orange">
    <!-- generic.xaml can contain one or more definitions for any number of custom controls within the project -->
    <!-- a project only has one themes\generic.xaml -->
    <!-- this is the definition for our basic control -->
    <Style TargetType="local:BasicCustomControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:BasicCustomControl">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"></Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- this is the definition for our control with a dependency property -->
    <Style TargetType="local:ImageWithLabelControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ImageWithLabelControl">
                    <Border Background="LightBlue" BorderBrush="Black" BorderThickness="2" HorizontalAlignment="Center" Width="140" Height="150">
                        <StackPanel HorizontalAlignment="Center">
                            <Image Stretch="Uniform" Width="100" Height="100" Source="{TemplateBinding ImagePath}" Margin="5"/>
                            <TextBlock TextAlignment="Center" Text="{TemplateBinding Label}" FontFamily="Seqoe UI" FontWeight="Light" FontSize="26.667" Foreground="Black"/>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>